home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / win / makefile.bc < prev    next >
Encoding:
Makefile  |  1997-08-15  |  8.6 KB  |  386 lines  |  [TEXT/ALFA]

  1. # Copyright (c) 1995-1996 Sun Microsystems, Inc.
  2. # SCCS: @(#) makefile.bc 1.80 97/07/30 14:19:01
  3. #
  4. # Borland C++ 4.5 makefile
  5. #
  6.  
  7. #
  8. # Project directories
  9. #
  10. # ROOT = top of source tree
  11. # TMPDIR = location where .obj files should be stored during build
  12. # TOOLS = location of compiler and other development tools
  13. #
  14.  
  15. ROOT    = ..
  16. TMPDIR    = .
  17. TOOLS    = c:\bc45
  18.  
  19. # uncomment the following line to compile with symbols
  20. #DEBUG=1
  21.  
  22. # uncomment one of the following lines to compile with TCL_MEM_DEBUG,
  23. # TCL_COMPILE_DEBUG, or TCL_COMPILE_STATS
  24. #DEBUGDEFINES   =TCL_MEM_DEBUG 
  25. #DEBUGDEFINES   =TCL_MEM_DEBUG;TCL_COMPILE_DEBUG
  26. #DEBUGDEFINES   =TCL_MEM_DEBUG;TCL_COMPILE_STATS
  27. #DEBUGDEFINES   =TCL_MEM_DEBUG;TCL_COMPILE_DEBUG;TCL_COMPILE_STATS
  28.  
  29.  
  30. ######################################################################
  31. # Do not modify below this line
  32. ######################################################################
  33.  
  34. VERSION = 80
  35.  
  36. TCLLIB         = tcl$(VERSION).lib
  37. TCLDLL         = tcl$(VERSION).dll
  38. TCL16DLL     = tcl16$(VERSION).dll
  39. TCLSH         = tclsh$(VERSION).exe
  40. TCLTEST     = tcltest.exe
  41. DUMPEXTS     = dumpexts.exe
  42. TCLPIPEDLL     = tclpip$(VERSION).dll
  43. TCLREGDLL     = tclreg$(VERSION).dll
  44. CAT16         = cat16.exe
  45. CAT32         = cat32.exe
  46.  
  47. TCLSHOBJS = \
  48.     $(TMPDIR)\tclAppInit.obj
  49.  
  50. TCLTESTOBJS = \
  51.     $(TMPDIR)\tclTest.obj \
  52.     $(TMPDIR)\tclTestObj.obj \
  53.     $(TMPDIR)\tclWinTest.obj \
  54.     $(TMPDIR)\testMain.obj
  55.  
  56. TCLOBJS = \
  57.     $(TMPDIR)\panic.obj \
  58.     $(TMPDIR)\regexp.obj \
  59.     $(TMPDIR)\strftime.obj \
  60.     $(TMPDIR)\tclAlloc.obj \
  61.     $(TMPDIR)\tclAsync.obj \
  62.     $(TMPDIR)\tclBasic.obj \
  63.     $(TMPDIR)\tclBinary.obj \
  64.     $(TMPDIR)\tclCkalloc.obj \
  65.     $(TMPDIR)\tclClock.obj \
  66.     $(TMPDIR)\tclCmdAH.obj \
  67.     $(TMPDIR)\tclCmdIL.obj \
  68.     $(TMPDIR)\tclCmdMZ.obj \
  69.     $(TMPDIR)\tclCompExpr.obj \
  70.     $(TMPDIR)\tclCompile.obj \
  71.     $(TMPDIR)\tclDate.obj \
  72.     $(TMPDIR)\tclEnv.obj \
  73.     $(TMPDIR)\tclEvent.obj \
  74.     $(TMPDIR)\tclExecute.obj \
  75.     $(TMPDIR)\tclFCmd.obj \
  76.     $(TMPDIR)\tclFileName.obj \
  77.     $(TMPDIR)\tclGet.obj \
  78.     $(TMPDIR)\tclHash.obj \
  79.     $(TMPDIR)\tclHistory.obj \
  80.     $(TMPDIR)\tclIndexObj.obj \
  81.     $(TMPDIR)\tclInterp.obj \
  82.     $(TMPDIR)\tclIO.obj \
  83.     $(TMPDIR)\tclIOCmd.obj \
  84.     $(TMPDIR)\tclIOSock.obj \
  85.     $(TMPDIR)\tclIOUtil.obj \
  86.     $(TMPDIR)\tclLink.obj \
  87.     $(TMPDIR)\tclListObj.obj \
  88.     $(TMPDIR)\tclLoad.obj \
  89.     $(TMPDIR)\tclMain.obj \
  90.     $(TMPDIR)\tclNamesp.obj \
  91.     $(TMPDIR)\tclNotify.obj \
  92.     $(TMPDIR)\tclObj.obj \
  93.     $(TMPDIR)\tclParse.obj \
  94.     $(TMPDIR)\tclPipe.obj \
  95.     $(TMPDIR)\tclPkg.obj \
  96.     $(TMPDIR)\tclPosixStr.obj \
  97.     $(TMPDIR)\tclPreserve.obj \
  98.     $(TMPDIR)\tclProc.obj \
  99.     $(TMPDIR)\tclStringObj.obj \
  100.     $(TMPDIR)\tclTimer.obj \
  101.     $(TMPDIR)\tclUtil.obj \
  102.     $(TMPDIR)\tclVar.obj \
  103.     $(TMPDIR)\tclWin32Dll.obj \
  104.     $(TMPDIR)\tclWinChan.obj \
  105.     $(TMPDIR)\tclWinError.obj \
  106.     $(TMPDIR)\tclWinFCmd.obj \
  107.     $(TMPDIR)\tclWinFile.obj \
  108.     $(TMPDIR)\tclWinInit.obj \
  109.     $(TMPDIR)\tclWinLoad.obj \
  110.     $(TMPDIR)\tclWinMtherr.obj \
  111.     $(TMPDIR)\tclWinNotify.obj \
  112.     $(TMPDIR)\tclWinPipe.obj \
  113.     $(TMPDIR)\tclWinSock.obj \
  114.     $(TMPDIR)\tclWinTime.obj
  115.  
  116. cc32        = $(TOOLS)\bin\bcc32.exe
  117. link32        = $(TOOLS)\bin\tlink32.exe
  118. rc32        = $(TOOLS)\bin\brcc32.exe
  119. implib        = $(TOOLS)\bin\implib.exe
  120.  
  121. cc16        = $(TOOLS)\bin\bcc.exe
  122. link16        = $(TOOLS)\bin\tlink.exe
  123. rc16        = $(TOOLS)\bin\brcc32.exe -31
  124.  
  125. CP        = copy
  126. RM        = del
  127.  
  128. WINDIR          = $(ROOT)\win
  129. GENERICDIR    = $(ROOT)\generic
  130.  
  131. INCLUDES    = $(TOOLS)\include;$(WINDIR);$(GENERICDIR)
  132. LIBDIRS        = $(TOOLS)\lib;$(WINDIR)
  133.  
  134. CON_CFLAGS    = +cfgexe.cfg -WC
  135. TEST_CFLAGS    = +cfgtest.cfg
  136. DLL16_CFLAGS    = $(PROJECTCCFLAGS) -I$(INCLUDES) -D$(DEFINES) -WD -ml -c \
  137.             -3 -d -w
  138. TCL_CFLAGS    = +cfgdll.cfg
  139.  
  140. CON_LFLAGS    = -Tpe -ap -c $(DEBUGLDFLAGS) $(TOOLS)\lib\c0x32
  141. DLL_LFLAGS    = -Tpd -aa -c $(DEBUGLDFLAGS) $(TOOLS)\lib\c0d32
  142. GUI_LFLAGS    = -Tpe -aa -c $(DEBUGLDFLAGS) $(TOOLS)\lib\c0w32
  143. DLL16_LFLAGS    = -Twd -c -C -A=16 $(DEBUGLDFLAGS16) $(TOOLS)\lib\c0dl
  144.  
  145. DLL_LIBS    = import32 cw32i
  146. CON_LIBS    = $(TCLLIB) import32 cw32i
  147. DLL16_LIBS    = import cwl
  148.  
  149. !ifndef DEBUG
  150.  
  151. # these macros cause maximum optimization and no symbols
  152. DEBUGLDFLAGS = 
  153. DEBUGCCFLAGS = -v- -vi- -O2
  154. DEBUGLDFLAGS16 = -Oc -Oi -Oa -Or
  155. !else
  156.  
  157. # these macros enable debugging
  158. DEBUGLDFLAGS = -v
  159. DEBUGCCFLAGS = -k -Od -v
  160. DEBUGLDFLAGS16 = 
  161.  
  162. !endif
  163.  
  164. DEFINES = _RTLDLL;$(DEBUGDEFINES)
  165. PROJECTCCFLAGS = $(DEBUGCCFLAGS) -w-par -w-stu
  166.  
  167.  
  168. # Global makefile settings
  169. #
  170.  
  171. .AUTODEPEND
  172. .CACHEAUTODEPEND
  173.  
  174. .suffixes:
  175.  
  176. #.path.c=$(ROOT)\win;$(ROOT)\generic;$(ROOT)\compat
  177. #.path.obj=$(TMPDIR)
  178. #.path.dll=$(ROOT)\win
  179.  
  180. #
  181. # Targets
  182. #
  183.  
  184. release:    $(TCLSH) dlls
  185. all:        $(TCLSH) dlls $(CAT16) $(CAT32) 
  186. tcltest:    $(TCLTEST) dlls $(CAT16) $(CAT32)
  187. dlls:        $(TCL16DLL) $(TCLPIPEDLL) $(TCLREGDLL)
  188.  
  189. test:        tcltest
  190.     $(TCLTEST) &&|
  191.         cd ../tests
  192.         source all
  193. |
  194.  
  195.  
  196. $(DUMPEXTS): cfgexe.cfg $(WINDIR)\winDumpExts.c
  197.     $(cc32) $(CON_CFLAGS) $(WINDIR)\winDumpExts.c
  198.     $(link32) $(CON_LFLAGS) \
  199.         $(TMPDIR)\winDumpExts.obj,$@,,import32 cw32i,,
  200.  
  201. $(TCLLIB): $(TCLDLL)
  202.     $(implib) -c $@ $(TCLDLL)
  203.  
  204. $(TCLDLL): cfgdll.cfg $(TCLOBJS) $(TMPDIR)\tcl.def $(TMPDIR)\tcl.res
  205.     $(link32) $(DLL_LFLAGS) @&&|
  206.         $(TCLOBJS)
  207. $@
  208. -x
  209. $(DLL_LIBS)
  210. |, $(TMPDIR)\tcl.def, $(TMPDIR)\tcl.res
  211.  
  212.  
  213. $(TCLSH): cfgexe.cfg $(TCLSHOBJS) $(TCLLIB) $(TMPDIR)\tclsh.res
  214.     $(link32) $(CON_LFLAGS) @&&|
  215.         $(TCLSHOBJS)
  216. $@
  217. -x
  218. $(CON_LIBS)
  219. |, &&|
  220. EXETYPE WINDOWS
  221. CODE PRELOAD MOVEABLE DISCARDABLE
  222. DATA PRELOAD MOVEABLE MULTIPLE
  223. |, $(TMPDIR)\tclsh.res
  224.  
  225. $(TCLTEST): cfgtest.cfg $(TCLTESTOBJS) $(TCLLIB) $(TMPDIR)\tclsh.res
  226.     $(link32) $(CON_LFLAGS) @&&|
  227.         $(TCLTESTOBJS)
  228. $@
  229. -x
  230. $(CON_LIBS)
  231. |, &&|
  232. EXETYPE WINDOWS
  233. CODE PRELOAD MOVEABLE DISCARDABLE
  234. DATA PRELOAD MOVEABLE MULTIPLE
  235. |, $(TMPDIR)\tclsh.res
  236.  
  237.  
  238. $(TCL16DLL): tcl16.rc $(ROOT)\win\tclWin16.c
  239.     $(cc16) @&&|
  240. $(DLL16_CFLAGS) -n$(TMPDIR) 
  241. | $(ROOT)\win\tclWin16.c
  242.     $(rc16) @&&|
  243. -i$(INCLUDES) -d__WIN32__;$(DEFINES) -fo$(TMPDIR)\tcl16.res
  244. | tcl16.rc
  245.     @copy >nul &&|
  246. LIBRARY $&;dll
  247. EXETYPE WINDOWS
  248. CODE PRELOAD MOVEABLE DISCARDABLE
  249. DATA PRELOAD MOVEABLE SINGLE
  250. HEAPSIZE 1024
  251. EXPORTS
  252.     WEP @1 RESIDENTNAME
  253.     UTPROC @2 
  254. | $(TMPDIR)\tclWin16.def
  255.     $(link16) $(DLL16_LFLAGS) @&&|
  256. $(TMPDIR)\tclWin16.obj
  257. $@
  258. nul
  259. $(DLL16_LIBS)
  260. $(TMPDIR)\tclWin16.def
  261. |
  262.     $(TOOLS)\bin\rlink $(TMPDIR)\tcl16.res $@
  263.  
  264. $(TCLPIPEDLL): cfgexe.cfg stub16.c
  265.     $(cc32) -c -tWC stub16.c
  266.     $(link32) $(CON_LFLAGS) -L$(TOOLS)\lib \
  267.         stub16.obj,$@,,import32 cw32,,
  268.  
  269. $(TCLREGDLL): extdll.cfg $(TMPDIR)\tclWinReg.obj
  270.     $(link32) $(DLL_LFLAGS) @&&|
  271.         $(TMPDIR)\tclWinReg.obj
  272. $@
  273. -x
  274. $(DLL_LIBS) $(TCLLIB)
  275. |,,
  276.  
  277. #
  278. # Special test targets
  279. #
  280.  
  281. $(CAT32): cat.c
  282.     $(cc32) -c -Ox -tWC -ocat32.obj cat.c
  283.     $(link32) $(CON_LFLAGS) -L$(TOOLS)\lib \
  284.         cat32.obj,$@,,import32 cw32,,
  285.  
  286. $(CAT16): cat.c
  287.     $(cc16) -W- -ml -Ox -c -ocat16.obj cat.c
  288.     $(link16) -Tde -c -L$(TOOLS)\lib $(TOOLS)\lib\c0l.obj cat16.obj,cat16.exe,,cl.lib,,
  289.  
  290. #######################################################################
  291. # Implicit Targets
  292. #######################################################################
  293.  
  294.  
  295. {$(WINDIR)}.c{$(TMPDIR)}.obj:
  296.     @$(cc32) $(TCL_CFLAGS) {$< }
  297.  
  298. {$(GENERICDIR)}.c{$(TMPDIR)}.obj:
  299.     @$(cc32) $(TCL_CFLAGS) {$< }
  300.  
  301. {$(ROOT)\compat}.c{$(TMPDIR)}.obj:
  302.     @$(cc32) $(TCL_CFLAGS) {$< }
  303.  
  304. {$(WINDIR)}.rc{$(TMPDIR)}.res:
  305.     $(rc32) -i$(INCLUDES) -fo$@ @&&|
  306. -d__WIN32__;$(DEFINES) $<
  307. |
  308.  
  309. #
  310. # Special case object file targets
  311. #
  312.  
  313. $(TMPDIR)\tclWinReg.obj : extdll.cfg $(ROOT)\win\tclWinReg.c
  314.     $(cc32) +extdll.cfg -o$@ $(ROOT)\win\tclWinReg.c
  315.  
  316. $(TMPDIR)\tclAppInit.obj : cfgexe.cfg $(ROOT)\win\tclAppInit.c
  317.     $(cc32) $(CON_CFLAGS) -o$@ $(ROOT)\win\tclAppInit.c
  318.  
  319. $(TMPDIR)\testMain.obj : cfgexe.cfg $(ROOT)\win\tclAppInit.c
  320.     $(cc32) $(TEST_CFLAGS) -o$@ $(ROOT)\win\tclAppInit.c
  321.  
  322. $(TMPDIR)\tclWin16.obj : $(ROOT)\win\tclWin16.c
  323.     $(cc16) $(DLL16_CFLAGS) -o$@ $(ROOT)\win\tclWin16.c
  324.  
  325. #
  326. # Configuration file targets - these files are implicitly used by the compiler
  327. #
  328.  
  329. cfgdll.cfg:
  330.     @$(CP) &&|
  331.         -n$(TMPDIR) -I$(INCLUDES) -c -WD
  332.         -D$(DEFINES) -3 -d -w $(PROJECTCCFLAGS)
  333. | cfgdll.cfg >NUL
  334.  
  335. extdll.cfg:
  336.     @$(CP) &&|
  337.         -n$(TMPDIR) -I$(INCLUDES) -c -WD
  338.         -D_RTLDLL;$(DEBUGDEFINES) -3 -d -w $(PROJECTCCFLAGS)
  339. | extdll.cfg >NUL
  340.  
  341. cfgexe.cfg:
  342.     @$(CP) &&|
  343.         -n$(TMPDIR) -I$(INCLUDES) -c -W
  344.         -D$(DEFINES) -3 -d -w $(PROJECTCCFLAGS)
  345. | cfgexe.cfg >NUL
  346.  
  347. cfgtest.cfg:
  348.     @$(CP) &&|
  349.         -n$(TMPDIR) -I$(INCLUDES) -c -W
  350.         -D$(DEFINES);TCL_TEST -3 -d -w $(PROJECTCCFLAGS)
  351. | cfgtest.cfg >NUL
  352.  
  353. cfgcln:
  354.     -@$(RM) *.cfg
  355.  
  356.  
  357. # The following rule automatically generates a tcl.def file containing
  358. # an export entry for every public symbol in the tcl.dll library.
  359.  
  360. $(TMPDIR)\tcl.def: $(TCLOBJS) $(DUMPEXTS)
  361.     $(DUMPEXTS) -o $(TMPDIR)\tcl.def $(TCLDLL) @&&|
  362.         $(TCLOBJS)
  363. |
  364.  
  365.  
  366. # the following two rules are a hack to get around the fact that the
  367. # 16-bit compiler doesn't handle long file names :-(
  368.  
  369. $(ROOT)\win\tclWinIn.h: $(ROOT)\win\tclWinInt.h
  370.     $(CP) $(ROOT)\win\tclWinInt.h $(ROOT)\win\tclWinIn.h
  371.  
  372. $(ROOT)\win\tclWin16.c: $(ROOT)\win\tclWinIn.h
  373.  
  374. # remove all generated files
  375.  
  376. clean:
  377.     -@$(RM) *.exe
  378.     -@$(RM) *.lib
  379.     -@$(RM) *.dll
  380.     -@$(RM) $(TMPDIR)\*.res
  381.     -@$(RM) $(TMPDIR)\*.def
  382.     -@$(RM) $(TMPDIR)\*.obj
  383.     -@$(RM) $(TMPDIR)\*.cfg
  384.     -@$(RM) $(ROOT)\win\tclWinIn.h
  385.